package com.liyueheng.app.dataWarehouseDetail

import com.liyueheng.app.dataWarehouseDetail.behavior._
import com.liyueheng.app.dataWarehouseDetail.portrait.{AgePortrait, GenderPortrait, RegionPortrait}
import com.liyueheng.app.dataWarehouseDetail.ranking.{Top10FemaleSpenders, Top10HotProducts, Top10MaleSpenders, Top10RegionSpenders, Top10Spenders}
import com.liyueheng.app.dataWarehouseDetail.rfm.{FrequencyScore, LastPurchaseDate, MonetaryScore, RfmScore, RfmSegmentSummary}

object DwdStartLauncher {
  /**
   * 启动数据仓库详细分析
   */
  def dwdStartLauncher(): Unit = {
    // 行为分析
    UniqueVisitors.uniqueVisitors()
    PageViews.pageViews()
    PvPerUvRatio.pvPerUvRatio()
    MonthlyActiveUser.analyzeMAU()
    HourlyActiveUser.analyzeHourlyActive()
    MonthlyActiveUser.analyzeMAU()
    UserRetention.analyzeRetention()
    BounceAndConversionRate.analyze()
    DailyPurchaseConversionRate.analyze()

    // 用户画像
    AgePortrait.analyzeAge()
    GenderPortrait.analyzeGender()
    RegionPortrait.analyzeRegion()

    // RFM分析
    FrequencyScore.calcF()
    LastPurchaseDate.calcR()
    MonetaryScore.calcM()
    RfmScore.calcRfmScores()
    RfmSegmentSummary.statSegment()

    // 排行榜
    Top10Spenders.stat()
    Top10FrequentBuyers.top10()
    Top10HotProducts.stat()
    Top10RegionSpenders.stat()
    Top10MaleSpenders.stat()
    Top10FemaleSpenders.stat()
  }
}
